<template>
  <div class="sxc-doc-wrap">
    <img class="sxc-doc" :src="cover" v-if="!play" />
    <sxc-pdf-viewer :pdfurl="pdfUrl" v-else />
  </div>
</template>

<script>
export default {
  name: 'sxc-document',
  data () {
    return {
      defaultImg: './static/img/img-doc.png'
    }
  },
  props: {
    play: {
      type: Boolean,
      default: false
    },
    docSrcList: {
      type: Array,
      default: () => []
    },
    switchTime: {
      type: [ String, Number ],
      default: ''
    }
  },
  computed: {
    cover () {
      return this.defaultImg
    },
    pdfUrl () {
      const { docSrcList } = this
      return docSrcList.length ? docSrcList[0].filePath : ''
    }
  }

}
</script>

<style lang="scss" scoped>
.sxc-doc-wrap {
}
</style>
